package io;

import java.io.Serializable;
import java.util.Arrays;

public class Person implements Serializable
{
    // 使用当前类测试对象流的 对象序列化 反序列化
    private String name;
    private int age;
    private String gneder;
    private String[] otherInfo;

    public Person()
    {
    }

    @Override
    protected void finalize() throws Throwable
    {
        System.out.println("what can i say  ha ha ha ...");
    }

    public Person(String name, int age, String gneder, String[] otherInfo)
    {
        this.name = name;
        this.age = age;
        this.gneder = gneder;
        this.otherInfo = otherInfo;
    }

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public int getAge()
    {
        return age;
    }

    public void setAge(int age)
    {
        this.age = age;
    }

    public String getGneder()
    {
        return gneder;
    }

    public void setGneder(String gneder)
    {
        this.gneder = gneder;
    }

    public String[] getOtherInfo()
    {
        return otherInfo;
    }

    public void setOtherInfo(String[] otherInfo)
    {
        this.otherInfo = otherInfo;
    }

    @Override
    public String toString()
    {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", gneder='" + gneder + '\'' +
                ", otherInfo=" + Arrays.toString(otherInfo) +
                '}';
    }
}
